﻿<%@ Page Title="" Language="C#" MasterPageFile="~/layout/admin.Master" AutoEventWireup="true" CodeBehind="EditOrder.aspx.cs" Inherits="SinhNhat.admin.EditOrder" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentHead" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentMain" runat="server">

    <asp:HiddenField ID="hdOrderID" runat="server" />
    <asp:HiddenField ID="hdStatus" runat="server" />

    <h2>Thông tin khách hàng</h2>

    <table>
        <tr>
            <td style="width:150px">Ngày giờ đặt hàng</td>
            <td>
                <asp:TextBox ID="txtCreateDate" runat="server" Width="250px" ReadOnly="true" BackColor="#f1f1f1" />
            </td>
        </tr>    
        <tr>
            <td>Tên khách hàng</td>
            <td>
                <asp:TextBox ID="txtName" runat="server" Width="500px" />
            </td>
        </tr>
        <tr>
            <td>Email</td>
            <td>
                <asp:TextBox ID="txtEmal" runat="server" Width="500px" />
            </td>
        </tr>
        <tr>
            <td>Điện thoại</td>
            <td>
                <asp:TextBox ID="txtPhone" runat="server" Width="500px" />
            </td>
        </tr>
        <tr>
            <td>Địa chỉ</td>
            <td>
                <asp:TextBox ID="txtAddress" runat="server" TextMode="MultiLine" Rows="4" Width="500px" />
            </td>
        </tr>
        <tr>
            <td>Ghi chú</td>
            <td>
                <asp:TextBox ID="txtNote" runat="server" TextMode="MultiLine" Rows="4" Width="500px" />
            </td>
        </tr>
        <tr>
            <td style="width:150px">Giá trị đơn hàng</td>
            <td>
                <asp:TextBox ID="txtPrice" runat="server" Width="250px" ReadOnly="true" BackColor="#f1f1f1" />
            </td>
        </tr>
        <tr>
            <td style="width:150px">Hình thức thanh toán</td>
            <td>
                <asp:TextBox ID="txtPayment" runat="server" Width="250px" ReadOnly="true" BackColor="#f1f1f1" /> <br />
                <asp:Label ID="lblInfoPayment" runat="server" />
            </td>
        </tr>
    </table>
    
    <h2>Sản phẩm đặt mua</h2>
               
    <asp:GridView ID="grProduct" runat="server" AutoGenerateColumns="False" 
        BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" 
        CellPadding="3" GridLines="Vertical">
        <AlternatingRowStyle BackColor="#DCDCDC" />
        <Columns>
            <asp:TemplateField HeaderText="STT" ItemStyle-Width="30px">
                <ItemTemplate>
                    <%# Container.DataItemIndex + 1 %>
                </ItemTemplate>

            <ItemStyle Width="30px"></ItemStyle>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Hình ảnh" ItemStyle-Width="70px">
                <ItemTemplate>
                    <img src='<%# Eval("PRODUCT.Image")%>' width="50px" />
                </ItemTemplate>

            <ItemStyle Width="70px"></ItemStyle>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Tên sản phẩm" ItemStyle-Width="200px">
                <ItemTemplate>
                    <a href='<%# Eval("PRODUCT.Url")%>'>
                        <%# Eval("PRODUCT.Name")%>
                    </a>
                </ItemTemplate>

            <ItemStyle Width="200px"></ItemStyle>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Số lượng đặt mua" ItemStyle-Width="70px">
                <ItemTemplate>
                    <%# Eval("Quantity")%>
                </ItemTemplate>

            <ItemStyle Width="120px"></ItemStyle>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Tình trạng sản phẩm" ItemStyle-Width="150px">
                <ItemTemplate>
                    <%# ((Boolean)Eval("PRODUCT.InStock")) ? "Còn hàng" : "Đã hết hàng"%>
                </ItemTemplate>

                <ItemStyle Width="150px"></ItemStyle>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
        <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
        <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#0000A9" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#000065" />
    </asp:GridView>

    <asp:Button ID="btnUpdate" runat="server" Text="Cập nhập" />
    <asp:Button ID="btnChangeStatus" runat="server" Visible="false" />
    <input type="button" value="Trở về danh sách" onclick="window.location = '/admin/AdminOrder.aspx';" />

</asp:Content>
